package com.example.demo.transational;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Propagation;

/**
 * create by Chas_tsj
 * 2024/10/23 16:11:48
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class Transactional {
    @Test
    public void test() {
        try {
            a();
        }catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    private void a() {
        b();
    }

    @org.springframework.transaction.annotation.Transactional(propagation = Propagation.NEVER)
    public void b() {
    }
}
